/*
 * @lc app=leetcode.cn id=389 lang=cpp
 *
 * [389] 找不同
 */

// @lc code=start
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
    char findTheDifference(string s, string t) {
        map<char, int> ms;
        for(auto& c : t)
        {
            ms[c]++;
        }
        for(auto& c : s)
        {
            ms[c]--;
        }

        char ans = 'a';
        for(auto& it:ms)
        {
            if(it.second)
            {
                ans = it.first;
            }
        }
        return ans;
    }
};
// @lc code=end

